package com.htc.model.request;

public class ConsumerRequest extends PageRequest{

	private String title;
	private String username;
	private String cellphone;
	private Integer id;
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	
	

	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String convertWhereStr() {
		StringBuffer bf = new StringBuffer("where 1=1 ");
		if(title!=null&&title.length()>0) {
			bf.append(" and username like '%"+title+"%'");
		}
		if(username!=null) {
			bf.append(" and username='"+username+"'");
		}
		if(cellphone!=null&&cellphone.length()>0) {
			bf.append(" and cellphone like '%"+cellphone+"%'");
		}
		if(id!=null) {
			bf.append(" and id="+id);
		}
		return bf.toString();
		
	}
	
}
